<pre>
<?php
error_reporting(E_ALL);
include 'library/Autoloader.php';
include 'include/config.inc.php';
include 'include/shared.inc.php';

/*
 * Creating an object using facotry
 */
$gallery = BusinessFactory::getObject('Application_Model_Gallery', 'ActiveRecord');
$gallery->setName('gallery');
$gallery->setDescription('This is a simple example gallery');
print_r($gallery);
echo $gallery->update();

echo $gallery->getId(); exit();
/*
 * Fetch the object from the repository and modify it
 */
$gal2 = BusinessRepository::getObject('Application_Model_Gallery', 'ActiveRecord', $gallery->getId());
$gal2->setName('gallery'.substr(rand(), 0, 4));
$gal2->update();
print_r($gal2);
?>
</pre>
